package com.heima.feigns.wemedia;

import com.heima.model.wemedia.pojos.WmUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("leadnews-wemedia")
public interface WemediaFeign {
    /**
     * 保存自媒体用户
     *
     * @param wmUser
     * @return wmUser 需要主键返回
     */
    @PostMapping("/api/v1/user/save")
    WmUser save(@RequestBody WmUser wmUser);

    /**
     * 根据ap_user_id查询当前用户
     *
     * @param id
     * @return
     */
    @GetMapping("/api/v1/user/findById/{id}")
    WmUser findByApUserId(@PathVariable("id") Integer id);

    /**
     * 根据登录名查询当前用户
     * @param name
     * @return
     */
    @GetMapping("/api/v1/user/findByName/{name}")
    WmUser findByName(@PathVariable("name") String name);
}
